# -*- coding: utf-8 -*-
from pdnstools.schema import Domain
from pdnstools.commonopts import create_option_parser, create_connection_string
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

def add_domain():
    session = Session()
    domain = Domain()
    domain.name = 'serv.in'
    domain.type = 'NATIVE'
    session.add(domain)
    session.commit()

if __name__ == '__main__':
    global Session
    parser = create_option_parser()
    (options, args) =  parser.parse_args()
    connstr = create_connection_string(options)
    engine = create_engine(connstr)
    Session = sessionmaker(bind=engine)
    add_domain()
